package org.potiorb.orb.marshal;

import javax.xml.soap.MessageFactory;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;


public class MarshalerSOAP {
	public static final String[] LocalName = {"TimeAsString", "TimeAsElapsed"};
	public static final String Namespace = "http://exe/";
	public static final String NamespacePrefix = "jb";
	
	public String timeAsString(){
		return null;
	}
	
	public long timeAsElapsed(){
		return 0;
	}
	
	public SOAPMessage create_soap_message() {
	       SOAPMessage msg = null;
	       try {
	         MessageFactory mf = MessageFactory.newInstance();
	         msg = mf.createMessage();
	       }
	       catch(SOAPException e) { System.err.println(e); }
	       return msg;
	}
	
	public Name create_qname(SOAPMessage msg, int method) {
	       Name name = null;
	       try {
	         SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
	         name = env.createName(LocalName[method], 
	         NamespacePrefix, 
	         Namespace);
	       }
	       catch(SOAPException e) { System.err.println(e); }
	       return name;
	    }
}
